package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ulwx.tool.DbUtils;
import com.ulwx.tool.ObjectUtils;
import feeinterface.modeldb.BaseGatewayKeyword;
/**
 * 
 * @author 黄杰
 *
 */
public class BaseGatewayKeywordDao {

	public static BaseGatewayKeyword getByKey(String key)throws Exception{
		String sql="select * from BaseGatewayKeyword where " +
				"INSTR(?,keyword)>0";
//		DataBase db = DataBaseFactory.getDataBase();
		Map<Integer,Object> map=new HashMap<Integer,Object>();
		map.put(1, key);
		List<BaseGatewayKeyword> list=DbUtils.doQueryClass(null,BaseGatewayKeyword.class,
				sql, map);
		if(list.size()>=1) return list.get(0);
		else{
			
		}
		return null;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		System.out.println(ObjectUtils.toJsonString(getByKey("55559999")));

	}

}
